package com.oygo.hunter.keep;

import android.content.Context;
import android.util.Log;

import com.oygo.hunter.decode.DecodeWrapper;
import com.register.CoS;
import com.register.MyService;
import com.register.SupService;
import com.oygo.hunter.utils.ProcessUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ProcessHolder {

    public static  Map map_extends;
    public static  Map map_float;
    public static  Map map_implements;
    public static  Map map_package;
    public static  Map map_private;
    public static  List list_synchronized;
    public static  Map map_throws;
    public static  Map map_volatile;

    static {
        ProcessHolder.map_float = new HashMap();
        ProcessHolder.map_package = new HashMap();
        ProcessHolder.map_volatile = new HashMap();
        ProcessHolder.map_private = new HashMap();
        ProcessHolder.map_throws = new HashMap();
        ProcessHolder.map_implements = new HashMap();
        ProcessHolder.map_extends = new HashMap();
        ProcessHolder.list_synchronized = new ArrayList();
    }

    public static void holder_extends(Context arg2) {
        for(Object v1: ProcessHolder.map_implements.values()) {
            Log.d("cql",v1.toString());
            MyService.startService(arg2, ((Class)v1));
        }
    }
    public static List holder_float(Context arg4) {
        ArrayList v0 = new ArrayList();
        for(Object v2: ProcessHolder.list_synchronized) {
            v0.add(ProcessHolder.holder_float(arg4, ((String)v2), ProcessHolder.map_private));
        }

        return v0;
    }

    public static String holder_float() {
        String v0 = ProcessUtils.p_private;
        if(v0 != null) {
            return (String)ProcessHolder.map_extends.get(v0);
        }

        throw new IllegalStateException("please init ProcessHolder first");
    }

    public static String holder_float(Context arg0, String arg1, Map arg2) {
        if(arg1 != null) {
            String v1 = (String)arg2.get(arg1);
            File v0 = arg0.getFilesDir();
            return v0 == null || v1 == null ? null : new File(v0, v1).getAbsolutePath();
        }

        throw new IllegalStateException("please init ProcessHolder first");
    }

    public static String holder_float(Context arg1, Map arg2) {
        return ProcessHolder.holder_float(arg1, ProcessUtils.p_private, arg2);
    }

    public static List holder(Context arg4) {
        ArrayList v0 = new ArrayList();
        for(Object v2: ProcessHolder.list_synchronized) {
            v0.add(ProcessHolder.holder_float(arg4, ((String)v2), ProcessHolder.map_private));
        }

        return v0;
    }

    public static void init(Context arg8) {
        String v8 = arg8.getPackageName();
        ProcessHolder.list_synchronized.add(v8);
        List v0 = ProcessHolder.list_synchronized;
        String v2 = DecodeWrapper.package_decode1("LvLtYIE/zonUVjQhmeLX0Q==");
        v0.add(v8 + v2);
        String v0_1 = DecodeWrapper.package_decode1("ouEYR4Vazbd5Nf6cmcN+Yg==");
        ProcessHolder.map_extends.put(v8, v0_1);
        ProcessHolder.map_float.put(v8, v0_1);
        String v0_2 = DecodeWrapper.package_decode1("bEpNWgLsPy/aNIBIbQqMKA==");
        ProcessHolder.map_package.put(v8, v0_2);
        String v1 = DecodeWrapper.package_decode1("7YTshpMqXUPoTwdUqZvFiA==");
        ProcessHolder.map_volatile.put(v8, v1);
        String v3 = DecodeWrapper.package_decode1("p1zWLZjHoG+C/RP2xHw9ng==");
        ProcessHolder.map_private.put(v8, v3);
        String v4 = DecodeWrapper.package_decode1("wR6fswj2AktDI/roaoczQc0jkCDpAiuWYpa2fQ6FpVg=");
        ProcessHolder.map_throws.put(v8, v4);
        String v5 = v8 + v2;
        Map v6 = ProcessHolder.map_extends;
        String v7 = DecodeWrapper.package_decode1("9pC2oOIq7vWlFs29V95lFw==");
        v6.put(v5, v7);
        ProcessHolder.map_float.put(v5, v7);
        ProcessHolder.map_package.put(v5, v1);
        ProcessHolder.map_volatile.put(v5, v0_2);
        ProcessHolder.map_private.put(v5, v4);
        ProcessHolder.map_throws.put(v5, v3);
        //补一个无声音频
        ProcessHolder.map_implements.put(v8, CoS.class);
        ProcessHolder.map_implements.put(v8 + v2, SupService.class);
    }

    public static String holder_package(Context arg1) {
        return ProcessHolder.holder_float(arg1, ProcessHolder.map_private);
    }

    public static String holder_private(Context arg1) {
        return ProcessHolder.holder_float(arg1, ProcessHolder.map_volatile);
    }

    public static String holder_throws(Context arg1) {
        return ProcessHolder.holder_float(arg1, ProcessHolder.map_throws);
    }

    public static String holder_volatile(Context arg1) {
        return ProcessHolder.holder_float(arg1, ProcessHolder.map_package);
    }

}
